package com.henu.rescue.service.impl;

import com.henu.rescue.entity.Category;
import com.henu.rescue.entity.TwoLevel;
import com.henu.rescue.entity.VO.CategoryAnalyse;
import com.henu.rescue.mapper.CategoryMapper;
import com.henu.rescue.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class CategoryServiceImpl implements CategoryService {

    @Autowired
    private CategoryMapper categoryMapper;

    //根据id增加num
    @Override
    public Integer updateNumById(Integer categoryId) {
        return categoryMapper.updateNumById(categoryId);
    }

    @Override
    public String selectNameById(Integer id) {
        return categoryMapper.selectNameById(id);
    }

    //获取二级标准下种类
    @Override
    public List<Category> selectIdNameByX(Integer x) {
        return categoryMapper.selectIdNameByX(x);
    }

    @Override
    public List<TwoLevel> selectIdNameY(Integer y) {
        return categoryMapper.selectIdNameY(y);
    }

    @Override
    public List<CategoryAnalyse> selectNatureByLevelId(Integer levelId) {
        return categoryMapper.selectNatureByLevelId(levelId);
    }

    @Override
    public List<CategoryAnalyse> selectHuman() {
        return categoryMapper.selectHuman();
    }

    @Override
    public  List<Map<Integer, String>> selectNamesByIds(List<Integer> ids) {
        return categoryMapper.selectNamesByIds(ids);
    }
}
